home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Freeware / AmiPCB / ARexx / EditScript.AmiPCB < prev    next >
Encoding:
Text File  |  2002-03-13  |  2.6 KB  |  80 lines

  1. /* Edition d'un script à l'aide de l'éditeur de texte AmiTex */
  2. /* Version 1.00: 18 juillet 2001, Chez Corbin */
  3. /* Version 1.01: 1er décembre 2001 (German localization by A. Greve) */
  4. /* Version 1.02: 20 janvier 2002 (utilisation PCBPATH) */
  5. /* $VER: EditScript.AmiPCB 1.02 (© R.Florac, 20-Jan-2002) */
  6. /* Chargement automatique d'un script dans AmiTex depuis AmiPCB */
  7. /* L'appel se fait en sélectionnant l'un des onze menus Macros/ARexx
  8.  * et en enfonçant en même temps la touche CONTROL (Ctrl).
  9.  *
  10.  * Les lignes 53, 55, 56, 60, 62, 65 doit être modifiée pour être conforme à votre système */
  11.  
  12. /* This script is called for loading a script file in a text editor
  13.  * while working with AmiPCB.
  14.  * Push the CONTROL key while selecting an ARexx menu with AmiPCB
  15.  * to call it.
  16.  * This script is for my text editor Amitex, adapt it
  17.  * to any other text editor to suit to your needs.
  18.  * Affected lines: 53, 55, 56, 60, 62, 65 */
  19.  
  20. /* Dieses Skript wird aufgerufen, wenn Skripte während des Arbeitens
  21.  * mit AmiPCB bearbeitet werden sollen.
  22.  * Drücken Sie CONTROL während der Selektion eines ARexx Menüpunktes,
  23.  * um es zu starten.
  24.  * Dieses Skript wurde für meinen Texteditor AmiTex geschrieben. Sie
  25.  * müssen es anpassen, wenn Sie einen anderen Editor benutzen.
  26.  * Betroffene Zeilen: 53, 55, 56, 60, 62, 65 */
  27.  
  28. signal on error             /* pour l'interception des erreurs */
  29. signal on syntax
  30.  
  31. options results
  32.  
  33. parse arg script            /* récupération du nom du script */
  34.  
  35. fr = 'ARexx/InitVars.AmiPCB'()
  36.  
  37. 'PCBPATH'
  38. pcbpath=result
  39.  
  40. if script = "" then do
  41.     select
  42.         when fr=1 then 'REQFILE("Fichier script à éditer", "'pcbpath'ARexx", "")'
  43.         when fr=2 then 'REQFILE("Zu bearbeitendes Skript", "'pcbpath'ARexx", "")'
  44.         otherwise      'REQFILE("Script file to edit", "'pcbpath'ARexx", "")'
  45.     end
  46.     script = result
  47.     if script="" then exit
  48. end
  49.  
  50. port = ADDRESS()                    /* lecture du nom du port AmiPCB */
  51.  
  52. address command
  53. if ~show(p, "AMITEX") then do       /* à améliorer... (AMITEX0, AMITEX1...) */
  54.     f=0                 /* il n'y avait pas de fenêtre ouverte */
  55.     'run > nil:' "SYS:tools/Amitex/AmiTex"  /* chargement de l'éditeur */
  56.     waitforport "AMITEX"
  57. end
  58. else f=1                /* il y a déjà une fenêtre active */
  59.  
  60. ADDRESS(AMITEX)
  61.  
  62. if f=1 then 'NEW("")'               /* demande l'ouverture d'une autre fenêtre */
  63. if ~exists(script) then script=script||".AmiPCB"
  64.  
  65. 'LOAD("'script'"):STOFRONT'         /* demande le chargement du script */
  66.  
  67. exit
  68.  
  69. /* Traitement des erreurs, interruption du programme */
  70. syntax:
  71. address (port)
  72. erreur=RC
  73. Call 'ARexx/_Syntax.rexx'(fr,'EditScript.AmiPCB',SIGL,erreur)
  74. exit
  75.  
  76. error:
  77. address (port)
  78. Call 'ARexx/_Error.rexx'(fr,'EditScript.AmiPCB',SIGL)
  79. exit
  80.